set more off
set scheme s2mono
use Rents_Data_GWF.dta, clear

gen ln_st_rents_pc_3y = ln(st_rents_pc_3y)
label var ln_st_rents_pc_3y "Ln St Rents/Cap"

****************************************
* Basic Exploration of Rents Variables *
****************************************
logit gwf_fail st_rents_pc_3y Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE if st_rents_pc_3y!=0, vce(cluster cnum)

reg st_rents_pc_3y gwf_military gwf_party ln_gdp if st_rents_pc_3y!=0

reg pr_rents_3y gwf_military gwf_party ln_gdp if st_rents_pc_3y!=0


**************
* Histograms *
**************
summ st_rents_pc_3y
hist st_rents_pc_3y if st_rents_pc_3y<20 & e(sample), bin(40) title("State Rents/Capita") xtitle("State Rents/Cap $") ylabel(#3) ///
graphregion(color(white)) bgcolor(white) xsize(6) ysize(6) fcolor(gs13) lcolor(black) lwidth(thin)
graph save st_rents_pc_hist, replace

hist ln_st_rents_pc_3y if st_rents_pc_3y<20 & e(sample), bin(40) title("State Rents/Capita") xtitle("State Rents/Cap $") ylabel(#3) ///
graphregion(color(white)) bgcolor(white) xsize(6) ysize(6) fcolor(gs13) lcolor(black) lwidth(thin)


summ st_rents_gdp_3y
display r(mean)+2*(r(sd))
hist st_rents_gdp_3y if st_rents_gdp_3y<(r(mean)+(r(sd))) & e(sample), bin(40) title("State Rents/GDP") xtitle("State Rents/GDP") ylabel(#3) ///
graphregion(color(white)) bgcolor(white) xsize(6) ysize(6) fcolor(gs13) lcolor(black) lwidth(thin)
graph save st_rents_gdp_hist, replace

summ pr_rents_3y
display r(mean)+(r(sd))
hist pr_rents_3y if pr_rents_3y<200 & pr_rents_3y>-200 & e(sample), bin(40) title("Producer Rents") xtitle("Producer Rents/Cap $") ylabel(#3) ///
graphregion(color(white)) bgcolor(white) xsize(6) ysize(6) fcolor(gs13) lcolor(black) lwidth(thin)
graph save pr_rents_hist, replace

summ Total_Oil_Income_PC
hist Total_Oil_Income_PC if Total_Oil_Income_PC<200 & e(sample), bin(40) title("Oil Income") xtitle("Oil Income/Cap $") ylabel(#3) ///
graphregion(color(white)) bgcolor(white) xsize(6) ysize(6) xlabel(0(50)200, format(%5.0f)) fcolor(gs13) lcolor(black) lwidth(thin)
graph save oil_pc_hist, replace

graph combine st_rents_pc_hist.gph st_rents_gdp_hist.gph pr_rents_hist.gph oil_pc_hist.gph, cols(2) graphregion(color(white)) xsize(6) ysize(6)
*graph export Rent_Histograms.pdf, replace

*** Look at the outliers on these variables
summ st_rents_pc_3y
browse ccode year st_rents_pc if st_rents_pc>(r(mean)+r(sd)) & st_rents_pc!=.

summ pr_rents_3y
browse ccode year pr_rents_3y if pr_rents_3y<(r(mean)-(r(sd))) | pr_rents_3y>(r(mean)+(r(sd))) & pr_rents_3y!=.



**********************************
* Correlations of Rent Variables *
**********************************
corr st_rents_pc_3y pr_rents_3y if e(sample)
* For a .tex file see after the
graph twoway (scatter st_rents_pc_3y pr_rents_3y if st_rents_pc_3y<33 & pr_rents_3y>-378 & pr_rents_3y<333 & e(sample), msymbol(Oh)) ///
(lfit st_rents_pc_3y pr_rents_3y if st_rents_pc_3y<33 & pr_rents_3y>-378 & pr_rents_3y<333  & e(sample), lpattern(solid) lwidth(medthick)), ///
xtitle("Producer Rents/Cap $") ytitle("State Rents/Cap $") title("Producer v State Rents") legend(off) xsize(4) ysize(4) graphregion(color(white)) bgcolor(white)
graph save corr_state_producer_rents, replace

corr st_rents_pc_3y st_rents_gdp_3y if e(sample)
graph twoway (scatter st_rents_pc_3y st_rents_gdp_3y if st_rents_pc_3y<33 & st_rents_gdp_3y<0.031 & e(sample), msymbol(Oh)) ///
(lfit st_rents_pc_3y st_rents_gdp_3y if st_rents_pc_3y<33 & st_rents_gdp_3y<0.031  & e(sample), lpattern(solid) lwidth(medthick)), ///
xtitle("State Rents/GDP") ytitle("State Rents/Cap $") title("State Rents") legend(off) xsize(4) ysize(4) graphregion(color(white)) bgcolor(white)
graph save corr_state_state_rents, replace

graph twoway (scatter Total_Oil_Income_PC st_rents_pc_3y if st_rents_pc_3y<33 & Total_Oil_Income_PC<224 & e(sample), msymbol(Oh)) ///
(lfit Total_Oil_Income_PC st_rents_pc_3y if st_rents_pc_3y<33 & Total_Oil_Income_PC<224  & e(sample), lpattern(solid) lwidth(medthick)), ///
ytitle("Oil Income/Cap $") ylabel(0(100)250, format(%5.0f)) xtitle("State Rents/Cap $") title("Oil Income") legend(off) xsize(4) ysize(4) graphregion(color(white)) bgcolor(white)
graph save corr_state_oil_rents, replace

corr st_rents_gdp_3y st_rents_pc_3y pr_rents_3y aggdp
graph twoway (scatter aggdp st_rents_gdp_3y if st_rents_gdp_3y<0.031  & e(sample), msymbol(Oh)) ///
(lfit aggdp st_rents_gdp_3y if st_rents_gdp_3y<0.031  & e(sample), lpattern(solid) lwidth(medthick)), ///
ytitle("Ag/GDP %") xtitle("State Rents/GDP") title("Agriculture") legend(off) xsize(4) ysize(4) graphregion(color(white)) bgcolor(white)
graph save corr_aggdp_state_rents, replace

graph combine corr_state_state_rents.gph corr_state_producer_rents.gph corr_state_oil_rents.gph corr_aggdp_state_rents.gph, cols(2) graphregion(color(white)) xsize(6) ysize(6)
*graph export Rent_Scatterplots.pdf, replace


*********************************
* Box Plots of Rents Indicators *
*********************************
* State Rents PC
graph box st_rents_pc_3y if st_rents_pc_3y<59 & st_rents_pc_3y!=0 & e(sample), over(ccode, sort(failures) label(labsize(small) angle(vertical))) ///
graphregion(fcolor(white)) bgcolor(white) scheme(s2color)
*graph export State_Rents_Box_Graph.pdf, replace

* State Rents/GDP
graph box st_rents_gdp_3y if e(sample), over(ccode, sort(failures) label(labsize(small) angle(vertical))) graphregion(fcolor(white)) bgcolor(white) scheme(s2color)

* Producer Rents
summ pr_rents_3y
graph box pr_rents_3y if pr_rents>-350 & pr_rents<550 & pr_rents!=0 & e(sample), over(ccode, sort(failures) label(labsize(small) angle(vertical))) ///
yline(0, lwidth(thin)) graphregion(fcolor(white)) bgcolor(white) scheme(s2color)
*graph export Producer_Rents_Box_Graph.pdf, replace



**********************
* State Rents Models *
**********************
btscs gwf_fail year ccode, gen(regyears) d(k) nspline(3)
label var _spline1 "Temporal Spline 1"
label var _spline2 "Temporal Spline 2"
label var _spline3 "Temporal Spline 3"
label var regyears "Years Since Failure"

* Model 2.1 Rents/Capita
logit gwf_fail st_rents_pc_3y Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE ///
_spline1 _spline2 _spline3 regyears if st_rents_pc_3y!=0, vce(cluster cnum)
est store st_rents_1
margins, at(st_rents_pc_3y=(0(5)150))
margins, at(st_rents_pc_3y=(0(5)60))
marginsplot, recast(line) recastci(rline) plot1opts(lwidth(medium)) ciopts(lwidth(thin) lpattern(longdash)) ///
title("State Rents Model 1") ytitle("Pr(Collapse)") xtitle("State Rents/Cap $") ///
addplot(kdensity st_rents_pc_3y if st_rents_pc_3y<60 & e(sample), ///
xlabel(0(15)60) yaxis(2) legend(pos(6) order(2 "Pr(Collapse)" 3 "State Rents"))) graphregion(color(white)) bgcolor(white) xsize(5) ysize(6)

* Model 2.2
logit gwf_fail st_rents_pc_3y Total_Oil_Income_PC iplandgini ///
ln_gdp Civil_War REGION_DEM_DIFFUSE gwf_military gwf_party polity_2 ///
_spline1 _spline2 _spline3 regyears if st_rents_pc_3y!=0, vce(cluster cnum)
est store st_rents_2
margins, at(st_rents_pc_3y=(0(5)60))
marginsplot, recast(line) recastci(rline) plot1opts(lwidth(medium)) ciopts(lwidth(thin) lpattern(longdash)) ///
title("State Rents Model 2") ytitle("Pr(Collapse)") xtitle("State Rents/Cap $") ///
addplot(kdensity st_rents_pc_3y if st_rents_pc_3y<60 & e(sample), ///
xlabel(0(15)60) yaxis(2) legend(pos(6) order(2 "Pr(Collapse)" 3 "State Rents"))) graphregion(color(white)) bgcolor(white) xsize(5) ysize(6)
margins, at(iplandgini=(0.4(0.05)0.75) Civil_War==0)

* Robustness test: Using logged variable
logit gwf_fail ln_st_rents_pc_3y Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE ///
_spline1 _spline2 _spline3 regyears if st_rents_pc_3y!=0, vce(cluster cnum)


* Interact with Land Gini - leave for now.
logit gwf_fail st_rents_pc_3y iplandgini sr_landgini Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE gwf_military gwf_party polity_2 ///
_spline1 _spline2 _spline3 regyears if st_rents_pc_3y!=0, vce(cluster cnum)

logit gwf_fail c.st_rents_pc_3y##c.iplandgini Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE gwf_military gwf_party polity_2 ///
_spline1 _spline2 _spline3 regyears if st_rents_pc_3y!=0, vce(cluster cnum)
margins, at(st_rents_pc_3y=(0(5)60) iplandgini=(0.4))
marginsplot, recast(line) recastci(rline) plot1opts(lwidth(medium)) ciopts(lwidth(thin) lpattern(longdash)) ///
title("Low Land Inequality" "Land Gini = 0.40") ytitle("Pr(Collapse)") xtitle("State Rents/Cap $") ///
addplot(kdensity st_rents_pc_3y if st_rents_pc_3y<60 & e(sample), ///
xlabel(0(15)60) yaxis(2) legend(pos(6) order(2 "Pr(Collapse)" 3 "State Rents"))) graphregion(color(white)) bgcolor(white) xsize(5) ysize(6)
graph save state_rents_lg_1, replace

margins, at(st_rents_pc_3y=(0(5)60) iplandgini=(0.75))
marginsplot, recast(line) recastci(rline) plot1opts(lwidth(medium)) ciopts(lwidth(thin) lpattern(longdash)) ///
title("High Land Inequality" "Land Gini = 0.75") ytitle("Pr(Collapse)") xtitle("State Rents/Cap $") ///
addplot(kdensity st_rents_pc_3y if st_rents_pc_3y<60 & e(sample), ///
xlabel(0(15)60) yaxis(2) legend(pos(6) order(2 "Pr(Collapse)" 3 "State Rents"))) graphregion(color(white)) bgcolor(white) xsize(5) ysize(6)
graph save state_rents_lg_2, replace
grc1leg state_rents_lg_1.gph state_rents_lg_2.gph, graphregion(color(white)) ycommon cols(2) title("State Rents")



* Rents/GDP
logit gwf_fail st_rents_gdp_3y Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE ///
_spline1 _spline2 _spline3 regyears if st_rents_gdp_3y!=0, vce(cluster cnum)
est store st_rents_3
margins, at(st_rents_gdp_3y=(0(.005).035))

logit gwf_fail st_rents_gdp_3y Total_Oil_Income_PC iplandgini ///
ln_gdp Civil_War REGION_DEM_DIFFUSE gwf_military gwf_party polity_2 ///
_spline1 _spline2 _spline3 regyears if st_rents_gdp_3y!=0, vce(cluster cnum)
est store st_rents_4
margins, at(st_rents_gdp_3y=(0(.005).035))

logit gwf_fail c.st_rents_gdp_3y##c.iplandgini Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE gwf_military gwf_party polity_2 ///
_spline1 _spline2 _spline3 regyears if st_rents_gdp_3y!=0, vce(cluster cnum)


* Table of results of state rents models
esttab st_rents_1 st_rents_2 st_rents_3 st_rents_4, ///
keep(st_rents_pc_3y st_rents_gdp_3y iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC Civil_War ln_gdp) ///
order(st_rents_pc_3y st_rents_gdp_3y iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC Civil_War ln_gdp) ///
mtitles("Rents/Cap" "Rents/Cap" "Rents/GDP" "Rents/GDP") ///
label b(2) se star(* 0.10 ** 0.05 *** 0.01) aic compress nogaps ///
addnotes("Controls: regime years, temporal splines, regional democracy.")

esttab st_rents_1 st_rents_2 st_rents_3 st_rents_4 using State_Rents_Collapse.tex, ///
keep(st_rents_pc_3y st_rents_gdp_3y iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC Civil_War ln_gdp) ///
order(st_rents_pc_3y st_rents_gdp_3y iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC Civil_War ln_gdp) ///
mtitles("Rents/Cap" "Rents/Cap" "Rents/GDP" "Rents/GDP") ///
label b(2) se star(* 0.10 ** 0.05 *** 0.01) aic compress nogaps replace ///
addnotes("Controls: regime years, temporal splines, regional democracy.")




*************************
* Producer Rents Models *
*************************
*Model 2.3 
logit gwf_fail pr_rents_3y Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE ///
_spline1 _spline2 _spline3 regyears if pr_rents_3y!=0, vce(cluster cnum)
est store pr_rents_1
margins, at(pr_rents_3y=(-85(20)65))


* Model 2.4
logit gwf_fail pr_rents_3y Total_Oil_Income_PC iplandgini ///
ln_gdp Civil_War REGION_DEM_DIFFUSE gwf_military gwf_party polity_2 ///
_spline1 _spline2 _spline3 regyears if pr_rents_3y!=0, vce(cluster cnum)
est store pr_rents_2
margins, at(pr_rents_3y=(-85(20)65))
margins, at(iplandgini=(0.35 0.75))


* Model 2.5 Interact producer rents with land Gini
logit gwf_fail pr_rents_3y iplandgini pr_landgini Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE ///
_spline1 _spline2 _spline3 regyears  if pr_rents_3y!=0, vce(cluster cnum)
est store pr_landgini_1
test pr_rents_3y iplandgini pr_landgini

logit gwf_fail c.pr_rents_3y##c.iplandgini Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE ///
_spline1 _spline2 _spline3 regyears  if pr_rents_3y!=0, vce(cluster cnum)
margins, at(pr_rents_3y=(-85(10)65))
margins, at(pr_rents_3y=(-85(10)65) iplandgini=(0.40))
margins, at(pr_rents_3y=(-85(10)65) iplandgini=(0.75))

margins, dydx(pr_rents_3y) at(iplandgini=(0.40(0.05)0.75))
marginsplot, recast(line) recastci(rline) plot1opts(lwidth(medium)) ciopts(lwidth(thin) lpattern(longdash)) ///
title("Model 2.5") ytitle("dydx(Pr Rents)") xtitle("Land Gini") ///
addplot(kdensity iplandgini if iplandgini>=0.40 & iplandgini<0.75 & e(sample), ///
xlabel(0.40(0.1)0.75) yaxis(2) legend(pos(6) order(2 "Marginal Effect" 3 "Land Gini"))) yline(0, lwidth(vthin)) graphregion(color(white)) bgcolor(white) xsize(5) ysize(6)
graph save pr_rents_me_1, replace


* Model 2.6 Include more control variables
logit gwf_fail pr_rents_3y iplandgini pr_landgini Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE gwf_military gwf_party polity_2 ///
_spline1 _spline2 _spline3 regyears  if pr_rents_3y!=0, vce(cluster cnum)
est store pr_landgini_2
test pr_rents_3y iplandgini pr_landgini 

* Run again to make margins plot
logit gwf_fail c.pr_rents_3y##c.iplandgini Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE gwf_military gwf_party polity_2 ///
_spline1 _spline2 _spline3 regyears if pr_rents_3y!=0, vce(cluster cnum)
margins, at(pr_rents_3y=(-85(10)65) iplandgini=(0.40))
margins, at(pr_rents_3y=(-85(10)65) iplandgini=(0.75))

margins, at(pr_rents_3y=(-300(50)300) iplandgini=(0.4))
marginsplot, recast(line) recastci(rline) plot1opts(lwidth(medium)) ciopts(lwidth(thin) lpattern(longdash)) ///
title("Low Land Inequality" "Land Gini = 0.40") ytitle("Pr(Collapse)") xtitle("Producer Rents/Cap $") ///
addplot(kdensity pr_rents_3y if pr_rents_3y>=-300 & pr_rents_3y<=300 & e(sample), ///
xlabel(-300(100)300) yaxis(2) legend(pos(6) order(2 "Probability" 3 "Producer Rents"))) ///
ylabel(-0.05(0.05)0.25) yline(0, lwidth(vthin)) ///
graphregion(color(white)) bgcolor(white) xsize(5) ysize(6)
graph save pr_landgini1, replace

margins, at(pr_rents_3y=(-300(50)300) iplandgini=(0.75))
marginsplot, recast(line) recastci(rline) plot1opts(lwidth(medium)) ciopts(lwidth(thin) lpattern(longdash)) ///
title("High Land Inequality" "Land Gini = 0.75") ytitle("Pr(Collapse)") xtitle("Producer Rents/Cap $") ///
addplot(kdensity pr_rents_3y if pr_rents_3y>=-300 & pr_rents_3y<=300 & e(sample), ///
xlabel(-300(100)300) yaxis(2) legend(pos(6) order(2 "Probability" 3 "Producer Rents"))) ///
ylabel(-0.05(0.05)0.25) yline(0, lwidth(vthin)) ///
graphregion(color(white)) bgcolor(white) xsize(5) ysize(6)
graph save pr_landgini2, replace
grc1leg pr_landgini1.gph pr_landgini2.gph, cols(2) graphregion(color(white)) ycommon
*graph export Producer_Rents_Collapse.pdf, replace

margins, dydx(pr_rents_3y) at(iplandgini=(0.40(0.05)0.75))
marginsplot, recast(line) recastci(rline) plot1opts(lwidth(medium)) ciopts(lwidth(thin) lpattern(longdash)) ///
title("Model 2.6") ytitle("dydx(Pr Rents)") xtitle("Land Gini") ///
addplot(kdensity iplandgini if iplandgini>=0.40 & iplandgini<0.75 & e(sample), ///
xlabel(0.40(0.1)0.75) yaxis(2) legend(pos(6) order(2 "Marginal Effect" 3 "Land Gini"))) ///
yline(0, lwidth(vthin)) graphregion(color(white)) bgcolor(white) xsize(5) ysize(6)
graph save pr_rents_me_2, replace
grc1leg pr_rents_me_1.gph pr_rents_me_2.gph, cols(2) graphregion(color(white)) ycommon
*graph export Producer_Rents_MEs.pdf, replace


* Using only the interpolated land Gini data
logit gwf_fail pr_rents_3y landgini_ipolated pr_iplandgini Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE ///
_spline1 _spline2 _spline3 regyears if pr_rents_3y>-1000, vce(cluster cnum)
est store pr_iplandgini

logit gwf_fail c.pr_rents_3y##c.landgini_ipolated Total_Oil_Income_PC ///
ln_gdp Civil_War REGION_DEM_DIFFUSE ///
_spline1 _spline2 _spline3 regyears if pr_rents_3y>-1000, vce(cluster cnum)
margins, dydx(pr_rents_3y) at(landgini_ipolated=(0.40(0.05)0.75))
margins, at(pr_rents_3y=(-85(10)65) landgini_ipolated=(0.40))
margins, at(pr_rents_3y=(-85(10)65) landgini_ipolated=(0.75))


* Table of producer rents results
esttab pr_rents_1 pr_rents_2 pr_landgini_1 pr_landgini_2 pr_iplandgini, ///
keep(pr_rents_3y iplandgini landgini_ipolated pr_landgini pr_iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC ln_gdp) ///
order(pr_rents_3y iplandgini landgini_ipolated pr_landgini pr_iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC ln_gdp) ///
mtitles("Pr Rents" "Pr Rents" "PR Land G" "PR Land G" "PR IP LG") ///
label b(2) se star(* 0.10 ** 0.05 *** 0.01) aic compress nogaps ///
addnotes("Controls: regime years, temporal splines, regional democracy.")

esttab pr_rents_1 pr_rents_2 pr_landgini_1 pr_landgini_2 pr_iplandgini using Producer_Rents_Collapse.tex, ///
keep(pr_rents_3y iplandgini landgini_ipolated pr_landgini pr_iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC ln_gdp) ///
order(pr_rents_3y iplandgini landgini_ipolated pr_landgini pr_iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC ln_gdp) ///
mtitles("Pr Rents" "Pr Rents" "PR Land G" "PR Land G" "PR IP LG") ///
label b(2) se star(* 0.10 ** 0.05 *** 0.01) aic compress nogaps replace ///
addnotes("Controls: regime years, temporal splines, regional democracy.")


* Table of State AND Producer rent models
esttab st_rents_1 st_rents_2  pr_rents_1 pr_rents_2 pr_landgini_1 pr_landgini_2 pr_iplandgini, ///
keep(st_rents_pc_3y pr_rents_3y iplandgini landgini_ipolated pr_landgini pr_iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC ln_gdp) ///
order(st_rents_pc_3y pr_rents_3y iplandgini landgini_ipolated pr_landgini pr_iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC ln_gdp) ///
mtitles("St Rents" "St Rents" "Pr Rents" "Pr Rents" "PR Land G" "PR Land G" "PR IP LG") ///
label b(2) se star(* 0.10 ** 0.05 *** 0.01) aic compress nogaps ///
addnotes("Controls: regime years, temporal splines, regional democracy.")

esttab st_rents_1 st_rents_2  pr_rents_1 pr_rents_2 pr_landgini_1 pr_landgini_2 pr_iplandgini using Rents_Collapse_Models.tex, ///
keep(st_rents_pc_3y pr_rents_3y iplandgini landgini_ipolated pr_landgini pr_iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC ln_gdp) ///
order(st_rents_pc_3y pr_rents_3y iplandgini landgini_ipolated pr_landgini pr_iplandgini ///
gwf_military gwf_party polity_2 Total_Oil_Income_PC ln_gdp) ///
mtitles("St Rents" "St Rents" "Pr Rents" "Pr Rents" "PR Land G" "PR Land G" "PR IP LG") ///
label b(2) se star(* 0.10 ** 0.05 *** 0.01) aic compress nogaps replace ///
addnotes("Controls: regime years, temporal splines, regional democracy.")

******************************
* Summary stats of variables *
******************************
*sutex gwf_fail st_rents_pc_3y pr_rents_3y iplandgini Total_Oil_Income_PC ln_gdp Civil_War REGION_DEM_DIFFUSE gwf_military gwf_party if e(sample), ///
*file ("Ch5_Var_Stats.tex") labels minmax dig(2) title("Summary Statistics, Rents Analysis") key(tab:ch5_var_stats) replace

*corrtex gwf_fail st_rents_pc_3y st_rents_gdp_3y pr_rents_3y iplandgini Total_Oil_Income_PC if e(sample), ///
*file ("Ch5_Corr_Tab.tex") dig(2) title("Correlation Table, Rents Analysis") key(tab:ch5_corr_tab) replace noscreen
